package cn.iocoder.yudao.module.picturebook.dal.mysql.classes;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.picturebook.dal.dataobject.classes.ClassesDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.picturebook.controller.admin.classes.vo.*;

/**
 * 班级信息 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface ClassesMapper extends BaseMapperX<ClassesDO> {


    ClassesDO queryClassesByClassCode(String classCode);

    default PageResult<ClassesDO> selectPage(ClassesPageReqVO pageReqVO){
          return selectPage(pageReqVO, new LambdaQueryWrapperX<ClassesDO>()
                .likeIfPresent(ClassesDO::getClassName, pageReqVO.getClassName())
                .eqIfPresent(ClassesDO::getTeacherId, pageReqVO.getTeacherId())
                .likeIfPresent(ClassesDO::getClassCode, pageReqVO.getClassCode())
                .betweenIfPresent(ClassesDO::getCreateTime, pageReqVO.getCreateTime())
                .orderByDesc(ClassesDO::getId));
    }

    void DeleteById(Long id);

    List<ClassesDO> getByTeacherId(Long teacherId);
}